<?php
namespace app\index\controller;
use think\Controller;
use think\Db;
class Returns extends Controller
{
	public function index(){
		$uid = session('uid');
		$data = DB::table('ma_usermoneylog')->alias('a')->join('ma_users b','a.uid = b.uid')->field('b.username,a.*')->where('a.pid',$uid)->whereTime('createtimes','today')->order('id desc')->paginate(15);
		 $moneys = db('usermoneylog')->field('SUM(money) as moneys')->where('pid',$uid)->whereTime('createtimes','today')->select();
		 $moneys = round($moneys[0]['moneys'],2);
		 $this->assign('data',$data);
		 $this->assign('moneys',$moneys);
		return $this->fetch();
	}
}